package com.zrrd.blog.system.feign;

import com.zrrd.blog.api.entities.SysMenu;
import com.zrrd.blog.api.entities.SysUser;
import com.zrrd.blog.api.feign.IFeignSystemController;
import com.zrrd.blog.system.service.ISysMenuService;
import com.zrrd.blog.system.service.ISysUserService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(value = "被远程调用的系统微服务接口",description = "被远程调用的系统微服务接口")
@RestController
public class FeignSystemController implements IFeignSystemController {

    @Autowired
    private ISysUserService sysUserService;

    @Autowired
    private ISysMenuService sysMenuService;

    @Override
    public SysUser findUserByUsername(String username) {
        return sysUserService.findUserByUsername(username);
    }

    @Override
    public List<SysMenu> findMenuListByUserIdForLogin(String userId) {
        return sysMenuService.findMenuListByUserIdForLogin(userId);
    }
}
